package webdev.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import dev.danang.R;


public class AboutMeFragment extends BaseFragment implements
		OnClickListener, AnimationListener {
	public static final String TAG = AboutMeFragment.class.getSimpleName(); // This is tag to show log
	ImageView imgAvatar;
	// Animation
	Animation animSideUp;
	// Animation
	Animation animSideTogether;
	public static AboutMeFragment newInstance() {
		AboutMeFragment f = new AboutMeFragment();
		Bundle args = new Bundle();
		f.setArguments(args);
		return f;
	}
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View layout = inflater.inflate(R.layout.about_fragment, null);
		init(layout);
		setValueForMembers();
		setEventForMembers();
		return layout;
	}
	
	@Override
	protected void init(View layout) {
		imgAvatar = (ImageView)layout.findViewById(R.id.imgAvatar);
	}
	
	@Override
	protected void setValueForMembers() {
		// TODO Auto-generated method stub
		// load the animation
		animSideUp = AnimationUtils.loadAnimation(getActivity(),
				R.anim.slide_down);
		// load the animation
		animSideTogether = AnimationUtils.loadAnimation(getActivity(),
				R.anim.together);
		animSideTogether.setAnimationListener(this);
		imgAvatar.startAnimation(animSideUp);
	}

	
	@Override
	protected void setEventForMembers() {
		// TODO Auto-generated method stub
	}

	
	@Override
	public void onClick(View v) {

	}
	/* (non-Javadoc)
	 * @see android.view.animation.Animation.AnimationListener#onAnimationEnd(android.view.animation.Animation)
	 */
	@Override
	public void onAnimationEnd(Animation animation) {
		// TODO Auto-generated method stub
		if(animation==animSideTogether)
		{
			imgAvatar.startAnimation(animSideUp);
		}
	}
	/* (non-Javadoc)
	 * @see android.view.animation.Animation.AnimationListener#onAnimationRepeat(android.view.animation.Animation)
	 */
	@Override
	public void onAnimationRepeat(Animation animation) {
		// TODO Auto-generated method stub
		
	}
	/* (non-Javadoc)
	 * @see android.view.animation.Animation.AnimationListener#onAnimationStart(android.view.animation.Animation)
	 */
	@Override
	public void onAnimationStart(Animation animation) {
		// TODO Auto-generated method stub
		
	}
	/* (non-Javadoc)
	 * @see webdev.fragment.BaseFragment#getUrl()
	 */
	@Override
	protected String getUrl() {
		// TODO Auto-generated method stub
		return null;
	}

}
